package com.button.boot.swagger.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api("swagger相关的api")
@RestController
@RequestMapping(value = "/sw")
public class SwaggerController {
    private static final Logger LOGGER = LoggerFactory.getLogger(SwaggerController.class);

    @ApiOperation(value = "swaggerDemoController", notes = "接口测试")
    @GetMapping(path = "/testInfo") 
    public String testInfo() {
        LOGGER.info("开始接口测试");
        return "你好";
    }
    
    @PostMapping(path = "/getId") 
    @ApiOperation(value = "获取id")
    public String getClcz(@RequestParam(value = "id", required = false) String id) {
        return id;
    }

}
